home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Audio / Patchmix / XWindowsSource / soundfile.c < prev    next >
C/C++ Source or Header  |  1992-03-28  |  1KB  |  57 lines

  1. static char rcsid[] = "$Header: soundfile.c,v 1.3 91/02/13 09:46:28 mara Exp $";
  2.  
  3. /* soundfile.c
  4.  *
  5.  *  Written by Mara Helmuth
  6.  *
  7.  *  Description: Sound file class 
  8.  *    for Cmix X graphical interface
  9.  * 
  10.  *  $Log:    soundfile.c,v $
  11.  * Revision 1.3  91/02/13  09:46:28  mara
  12.  * panel fixes
  13.  * 
  14.  * Revision 1.2  90/09/07  20:50:28  mara
  15.  * stereo
  16.  * 
  17.  * Revision 1.1  90/08/27  17:09:33  mara
  18.  * Initial revision
  19.  * 
  20.  * 
  21. */
  22.  
  23. #include "plus.h"
  24.  
  25. void soundfile::write()
  26. {
  27.     SR = atol(panelitem_get(panel,pi_srate,LXPTEXT_VALUE));
  28.     chans = *((int *)(panelitem_get(panel,pi_outchans,LXPENUM_VALUE))) + 1;
  29.     char* cmd = new char[50];
  30.     sprintf(cmd,"sfcreate -r %ld -c %d -f ./sf/%s",SR,chans,inst.name);
  31.     system(cmd);
  32.     sprintf(cmd,"Newinst/%s < Newinst/data",inst.name);
  33.     system(cmd);
  34.     delete cmd;
  35. }
  36.  
  37. void soundfile::rescale()
  38. {
  39.     char* cmd = new char[50];
  40.     sprintf(cmd,"cmix/bin/rescale -z ./sf/%s",inst.name);
  41.     system(cmd);
  42.     delete cmd;
  43. }
  44.  
  45. void soundfile::play()
  46. {
  47.     char* cmd = new char[50];
  48. #ifdef WOOF
  49.     sprintf(cmd,"play -i ./sf/%s.short",inst.name);
  50. #else
  51.     sprintf(cmd,"play ./sf/%s.short",inst.name);
  52. #endif
  53.     system(cmd);
  54.     delete cmd;
  55. }
  56.  
  57.